package com.mashibing.servicemap.service;

import com.mashibing.dto.ForecastPrice;
import com.mashibing.dto.ResponseResult;
import com.mashibing.responsse.DirectionResponse;
import com.mashibing.servicemap.remote.AmapDirectionRemote;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

@Service
public class DirectionService {
    @Autowired
    private AmapDirectionRemote amapDirectionRemote;
    public ResponseResult driving(ForecastPrice forecastPrice) {
        // 调用高德接口服务
        // 返回结果
        Optional<DirectionResponse> direction = amapDirectionRemote.direction(forecastPrice);

        return ResponseResult.success(direction);
    }
}
